#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
	long n=1,a=1,i=1;
	double pi = 0.0,num=1.0;
	do {
		num = 1.0 / n;
		pi += num*a;
		a = -a;
		n += 2;
		i++;
		
	} while (i<=500000);
	pi = pi * 4;
	printf("%.6f\n", pi);
	return 0;
}
